<%@ page language="java" contentType="text/html;charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ page import="entity.*, java.util.*" %>
<!DOCTYPE html>
<html>
<head>
    <%
        User loginUser = (User) session.getAttribute("lu"); //与head.jsp重复定义
        Map<Product, Integer> shoppingcar = (Map<Product, Integer>) session.getAttribute("sc");
    %>
    <meta charset="utf-8">
    <title><%=loginUser.getUsername()%>的购物车</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/header.css">
    <link rel="stylesheet" href="css/searchnav.css">
    <link rel="stylesheet" href="css/footer.css">
    <link rel="stylesheet" href="css/shopcart.css">
    <script src="js/jquery.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/vue.js"></script>
</head>
<body>
<div id="app">
    <div class="container-fluid">
        <!-- 头部导航 -->
        <section id="header">
            <div class="header-box">
                <div class="address">
                    <select>
                        <option>成都市</option>
                        <option>绵阳市</option>
                        <option>上海市</option>
                        <option>深圳市</option>
                    </select>
                </div>
                <div class="nav">
                    <ul>
                        <li><a href="index.html">首页 &ensp;/</a></li>
                        <li><a href="register.html">注册 &ensp;/</a></li>
                        <li><a href="#">签到有礼 &ensp;/</a></li>
                        <li><a href="#">我的订单 &ensp;/</a></li>
                        <li><a href="#">我的特卖 &ensp;/</a></li>
                        <li><a href="#">会员俱乐部 &ensp;/</a></li>
                        <li><a href="#">客服服务 &ensp;/</a></li>
                        <li><a href="#">手机版 &ensp;/</a></li>
                        <li><a href="#">更多</a></li>
                    </ul>
                </div>
            </div>
        </section>
        <!-- 搜索框+导航栏 -->
        <section id="search-nav">
            <div class="search-nav-box">
                <div class="serach">
                    <div class="logo" style="flex: 1;">
                        <img src="img/logo.png" alt="">
                    </div>
                    <div class="adver" style="flex: 2;">
                        <img src="img/advertising.jpg"/>
                    </div>
                    <div calss="serach-border" style="flex: 2;">
                        <div class="serach-box">
                            <div>
                                <input type="text" placeholder="6.16户外运动日">
                            </div>

                            <div class="btns">
                                搜索
                            </div>
                        </div>
                    </div>
                    <div class="shop-cart" style="flex: 1;">

                    </div>
                </div>
                <div class="navbars">
                    <div class="active">商品分类</div>
                    <div>推荐</div>
                    <div>3折疯抢</div>
                    <div>唯品快抢</div>
                    <div>唯品奥莱</div>
                    <div>女装</div>
                    <div>运动</div>
                    <div>鞋包</div>
                    <div>美妆</div>
                    <div>母婴</div>
                    <div>电器</div>
                    <div>男装</div>
                    <div>内衣</div>
                    <div>更多</div>
                </div>
            </div>
        </section>
        <hr/>
        <!-- 购物车 -->
        <section>
            <div class="shopcart-box">
                <table class="table">
                    <thead>
                    <tr>
                        <th></th>
                        <th>商品</th>
                        <th style="width: ;">价格</th>
                        <th style="text-align: center;padding-right: 40px">数量</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <%for (Product p : shoppingcar.keySet()) {%>
                    <tr>
                        <td><input type="checkbox" name="" id=""></td>
                        <td class="goods">
                            <div class="detail">
                                <div style="flex: 0.5;"><img
                                        src="<%=p.getPicPath()%>"
                                        alt=""></div>
                                <div style="flex: 1;padding: 10px; padding-top: 25px;"><%=p.getInfo()%>
                                </div>
                            </div>
                        </td>
                        <td>￥<%=p.getPrice() * shoppingcar.get(p)%>
                        </td>
                        <td class="number">
                            <div class="num">
                                <div class="">
                                    <form action="add_to_car" method="post">
                                        <input type="hidden" name="pid" value="<%=p.getId()%>">
                                        <input type="hidden" name="count" value="1">
                                        <input type="submit" value="+">
                                    </form>
                                </div>
                                <div><input type="text" value="<%=shoppingcar.get(p)%>"></div>
                                <div class="">
                                    <form action="sub_to_car" method="post">
                                        <input type="hidden" name="pid" value="<%=p.getId()%>">
                                        <input type="hidden" name="count" value="1">
                                        <input type="submit" value="-">
                                    </form>
                                </div>
                            </div>
                        </td>
                        <td>
                            <a href="http://localhost:8080/shopping_war/remove?pid=<%=p.getId()%>&count=<%=shoppingcar.get(p)%>">删除</a>
                        </td>
                    </tr>

                    <%}%>
                    <tr>
                        <td colspan="5" style="height: 70px; border:none">
                            <button class="btn btn-danger">
                                <a href="create_order" style="color: #ffffff;text-decoration: none">提交订单</a>
                            </button>
                        </td>
                        </td>

                    </tr>
                    </tbody>
                </table>
            </div>
        </section>
        <hr/>
        <!--底部 -->
        <div id="footer">
            <div class="login-footer" style="margin-top: 60px;">
                <div>
                    <img style="display:block;margin: 0 auto;"
                         src="https://shop.vipstatic.com/img/common/footer_common_20200705-hash-2a8e96cf.png"
                         alt="">
                </div>
                <div style="display: flex; text-align: center; margin-top: 50px;">
                    <div style="flex: 1;">
                        <p>服务保障</p>
                        <ul class="footer-text">
                            <li>正品保证</li>
                            <li>7天无理由放心退</li>
                            <li>7x15小时客户服务</li>
                            <li>7天无理由随心换</li>
                        </ul>
                    </div>
                    <div style="flex: 1;">
                        <p>服务保障</p>
                        <ul class="footer-text">
                            <li>正品保证</li>
                            <li>7天无理由放心退</li>
                            <li>7x15小时客户服务</li>
                            <li>7天无理由随心换</li>
                        </ul>
                    </div>
                    <div style="flex: 1;">
                        <p>服务保障</p>
                        <ul class="footer-text">
                            <li>正品保证</li>
                            <li>7天无理由放心退</li>
                            <li>7x15小时客户服务</li>
                            <li>7天无理由随心换</li>
                        </ul>
                    </div>
                    <div style="flex: 1;">
                        <p>服务保障</p>
                        <ul class="footer-text">
                            <li>正品保证</li>
                            <li>7天无理由放心退</li>
                            <li>7x15小时客户服务</li>
                            <li>7天无理由随心换</li>
                        </ul>
                    </div>
                    <div style="flex: 1;">
                        <p>服务保障</p>
                        <ul class="footer-text">
                            <li>正品保证</li>
                            <li>7天无理由放心退</li>
                            <li>7x15小时客户服务</li>
                            <li>7天无理由随心换</li>
                        </ul>
                    </div>
                    <div style="flex: 1;">
                        <p>服务保障</p>
                        <ul class="footer-text">
                            <li>正品保证</li>
                            <li>7天无理由放心退</li>
                            <li>7x15小时客户服务</li>
                            <li>7天无理由随心换</li>
                        </ul>
                    </div>
                </div>
                <div class="txt" style="text-align: center; margin-top: 20px;">
                    <p>Copyright © 2008-现在 vip.com，All Rights Reserved 使用本网站即表示接受 唯品会用户协议。版权所有 广州唯品会电子商务有限公司</p>
                    <p>粤公网安备 44010302111111号 粤ICP备08114786号 增值业务经营许可证：粤B2-20170777 网络文化经营许可证：粤网文〔2021〕2056-282号
                    </p>
                    <p>经营主体证照 风险监测信息 互联网药品信息服务资格证书：（粤）-经营性-2018-0271 网络食品交易第三方平台备案凭证：粤B2-20170777
                        医疗器械网络交易服务第三方平台备案
                    </p>
                    <p>凭证：（粤）网械平台备字[2019]第00001号 出版物网络交易平台服务经营备案证：粤新出网备（2021）1号 未成年人关怀专区</p>
                    <p>违法和不良信息举报电话：4006789888 算法推荐违规举报电话：4006789888</p>
                </div>

            </div>
        </div>
    </div>
</div>
</body>
</html>
